import { getRepository } from 'typeorm'
import User from '../../entity/UserEntity'

class UserModel {

  public static getUserList = () => {
    return getRepository(User).find()
  }

  public static getUserById = (id: number, select?: []) => {
    return getRepository(User).find({
      select,
      where: {id}
    })
  }
}

export default UserModel
